package com.woniu.supermarket.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResultResponse<T> {

    /**
     * 登录成功： code: 200，
     * 账号不存在: code:201，
     * 密码错误：code:202，
     * 验证码错误：code:203，
     *
     * code:200  ==>  success，
     * code:201  ==>  error，
     * code:555  ===> 系统错误，
     */

    private int code ;
    private String msg ;
    private T data ;
    private String token ;

    public ResultResponse(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResultResponse(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

}
